﻿namespace Pub.Class
{
    using System;
    using System.Web;

    public class ImagesHandler : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            string filePath = context.Request.FilePath;
            string str2 = Request2.GetReferrer().ToLower();
            string str3 = "http://" + Request2.GetHost().ToLower();
            if ((string.IsNullOrEmpty(filePath) || string.IsNullOrEmpty(str2)) || ((str2.IndexOf(str3) != 0) || (filePath.IndexOf(str3) != 0)))
            {
                context.Response.ContentType = "image/JPEG";
                context.Response.WriteFile("/no.jpg");
            }
        }

        public bool IsReusable
        {
            get
            {
                return true;
            }
        }
    }
}

